#ifndef _SKIN_COLUMN_H_
#define _SKIN_COLUMN_H_

#include "SkinElement.h"

class CNateRenderer;

class CSkinRow : public CSkinElementComposite {
public:
	CSkinRow() {}
	virtual ~CSkinRow() {}
	
	virtual void AdjustChildPosition();
protected:
	virtual BOOL IsValidChildTagName(CString strName) { return strName == _T("td"); }
};

class CSkinColumn : public CSkinRow {
public:
	CSkinColumn() 
	{
		m_size_image_src.cx = 0;
		m_size_image_src.cy = 0;
		m_ptLT_image_src.x = m_ptLT_image_src.y = 0;
		m_bImageFillTiled = FALSE;
		m_bOwnerFillTiled = FALSE;
		m_bOwnerdraw = FALSE ;

		m_bAlpha = FALSE;
		m_pAlphaMap = NULL;
		m_bTransparent = FALSE;
		m_iStretchMode = TILED_DRAW_STRETCH_HEIGHT;
	}
	virtual ~CSkinColumn() 
	{
		/*
		if( m_hBackImage && m_bAlpha )
			::DeleteObject( m_hBackImage );
		*/
	}
		
protected:
	POINT m_ptLT_image_src;
	SIZE m_size_image_src;
	BOOL m_bImageFillTiled;		
	BOOL m_bOwnerFillTiled;

	BOOL m_bAlpha, m_bTransparent;
	BYTE* m_pAlphaMap;

	int m_iStretchMode;
	BOOL LoadImagePosition( CString strMsg );

	virtual BOOL IsValidChildTagName(CString strName) { return strName != _T("tr"); }	
public:
	virtual void ReloadImage();
	virtual BOOL Load(TiXmlNode * pNode);
	virtual void Render(CNateRenderer * pImage);
};

#endif